package pl.com.sjap.wizualizator;

import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;

public class Wizualizacja extends JFrame {
	private JLabel background;
	private JLabel auto;
	
	private JPanel panel;
	
	public Wizualizacja() throws InterruptedException{
		super();
		setDefaultCloseOperation(EXIT_ON_CLOSE);
		setTitle("Kompresja obrazu");
		setLayout(null);
//		panel = new JPanel();
//		panel.setLayout(null);
		Agent agent = new Agent("Ferarri", 500, 500, "images/auto.png");
		
		background = new JLabel();
		background.setSize(1650, 1024);
		background.setIcon(new ImageIcon("images/tlo.png"));
		background.setBounds(0, 0, 1650, 1024);
		this.setContentPane(background);
		//panel.add(background);
		
		auto = new JLabel();
		auto.setSize(100, 100);
		auto.setBounds(500, 500, 140, 140);
		auto.setIcon(new ImageIcon("images/auto.png"));
		//panel.add(auto);
		add(agent.getImage());
		setSize(1650, 1024);
		this.setLocationRelativeTo(null);
		this.setVisible(true);	
		
		//Przykład poruszania sie
		Thread.sleep(1000);
		agent.przesun(0, -20);
		Thread.sleep(1000);
		agent.przesun(0, -20);
		Thread.sleep(1000);
		agent.przesun(0, -20);
		Thread.sleep(1000);
		agent.przesun(0, -20);
		Thread.sleep(1000);
		agent.przesun(0, -20);
		Thread.sleep(1000);
		agent.przesun(0, -20);
		Thread.sleep(1000);
		agent.przesun(0, -20);
		Thread.sleep(1000);
		agent.przesun(0, -20);
		Thread.sleep(1000);
		agent.przesun(0, -20);
		Thread.sleep(1000);
		//////////////////////////
	}
	public static void main(String args[]){
		try {
			Wizualizacja wiz = new Wizualizacja();
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	

}
